<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %>
<%@page import="com.ipartek.fila2.bean.Alumno" %>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css"/>
<link rel="stylesheet" type="text/css" href="css/jquery.dataTables_themeroller.css"/>
<link rel="stylesheet" type="text/css" href="themes/smoothness/jquery-ui-1.8.4.custom.css"/>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<title><%= request.getAttribute("tittle") %></title>
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery.dataTables.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
</head>
<body>
	<script>
	
	//esperamos a cargar toda la pagina
	$(document).ready(function(){
		//alert("Funciona Jquery");
		$('#tablaRanking').dataTable({
			"bJQueryUI": true
		});
	});
	
	</script>
	
		<fieldset>
			<legend>Ranking de tirada de alumnos</legend>
			<table id="tablaRanking">
				<thead>
					<tr>
						<th>id</th>
						<th>Nombre</th>
						<th>Apellido1</th>
						<th>Apellido2</th>
						<th>E-amil</th>
						<th>DNI</th>
						<th>Num Tiradas</th>
					</tr>
				</thead>
				<tbody>
				<!-- Escribimos una fila por cada elemento de la lista -->
				<%
					ArrayList<Alumno> lista=(ArrayList<Alumno>) request.getAttribute("ListaAlumnos"); 
					
					Iterator<Alumno> it = lista.iterator();
					Alumno alumno;
					
					while (it.hasNext()) {
						alumno = it.next();
						out.print("<tr>");
						out.print("<td>"+alumno.getId_alumno() +"</td>");
						out.print("<td>"+alumno.getNombre() +"</td>");
						out.print("<td>"+alumno.getApellido1() +"</td>");
						out.print("<td>"+alumno.getApellido2() +"</td>");
						out.print("<td>"+alumno.getEmail() +"</td>");
						out.print("<td>"+alumno.getDni() +"</td>");
						out.print("<td>"+alumno.getNum_tiradas() +"</td>");
						out.print("</tr>");
					
					}
				%>
				
				</tbody>
				<tfoot></tfoot>
			</table>
		</fieldset>
</body>
</html>